<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
{include file="public/top"}
</head>
<body>
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-member-add">
	
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>版本号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="number" name="number">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>新版下载地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="edition" name="edition">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" id="sub">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
{include file="public/footer"} <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript" src="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="__STATIC__/admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="__STATIC__/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
 $(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").validate({
		rules:{
			number:{
				required:true,
			
			},
			edition:{
				required:true,
				
			},

		 
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			//=================
			var number =$('#number').val();
			var edition =$('#edition').val();
			$.post("{:url('edition/add')}",{number:number,edition:edition,},function(data){
				if(data == 1){
					layer.msg('添加版本成功',{icon: 1,time:3000,shade: [0.8, '#393D49']},function(index){	
							// var index = parent.layer.getFrameIndex(window.name);
							//parent.$('.btn-refresh').click();
							parent.layer.close(index);
							parent.window.location.href="{:url('edition/index')}";
						});	
					
				}else if(data == 0){
					layer.msg('添加版本失败',{icon: 2,time: 2000,shade: [0.8, '#393D49']},function(){
						
							return false;
						});
				}
				
				
			});
			//================
			
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>